package com.itheima.day11;

import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位整数:");
        int num = sc.nextInt();
        if(num >=100 && num <= 999){
            int ge = num / 10;
            int shi = num % 10 / 10;
            int bai = num % 100;
            //判断个位的立方加十位的立方加百位的立方是否等于录入的三位数
            if(ge * ge * ge + shi * shi * shi + bai * bai * bai == num){
                System.out.println(num+"是水仙花数");
                }else {
                System.out.println(num+"不是是水仙花数");
            }
            }else {
                System.out.println("输出有误!");
        }
    }
}
